/**
 *
 * @param target {Window | HTMLElement}
 * @param onEnd {Function|undefined}
 */
export function initWheelEvent(target = window, {onEnd} = {}) {
    let wheelEventEndTimeout = null;
    target.addEventListener('wheel', (e) => {
        // console.log('wheel is being used');
        clearTimeout(wheelEventEndTimeout);
        wheelEventEndTimeout = setTimeout(() => {
            // console.log('wheel end', e);
            if (onEnd) {
                onEnd(e)
            }
        }, 100);
    });
}
